package com.netas.kekmanager.dao.model;

import com.netas.kekmanager.dao.*;
import com.netas.kekmanager.dao.factory.*;
import com.netas.kekmanager.dao.exceptions.*;
import java.io.Serializable;
import java.util.*;
import java.util.Date;

public class Comment implements Serializable
{
	/** 
	 * This attribute maps to the column id in the comment table.
	 */
	protected int id;

	/** 
	 * This attribute maps to the column text in the comment table.
	 */
	protected String text;

	/** 
	 * This attribute maps to the column user_id in the comment table.
	 */
	protected int userId;

	/** 
	 * This attribute maps to the column web_resource_id in the comment table.
	 */
	protected int webResourceId;

	/** 
	 * This attribute maps to the column time in the comment table.
	 */
	protected Date time;
        
        protected String userText;
        
        protected int likeCount;

	/**
	 * Method 'Comment'
	 * 
	 */
	public Comment()
	{
	}

    public String getUserText() {
        return userText;
    }

    public void setUserText(String userText) {
        this.userText = userText;
    }

    public int getLikeCount() {
        return likeCount;
    }

    public void setLikeCount(int likeCount) {
        this.likeCount = likeCount;
    }

	/**
	 * Method 'getId'
	 * 
	 * @return int
	 */
	public int getId()
	{
		return id;
	}

	/**
	 * Method 'setId'
	 * 
	 * @param id
	 */
	public void setId(int id)
	{
		this.id = id;
	}

	/**
	 * Method 'getText'
	 * 
	 * @return String
	 */
	public String getText()
	{
		return text;
	}

	/**
	 * Method 'setText'
	 * 
	 * @param text
	 */
	public void setText(String text)
	{
		this.text = text;
	}

	/**
	 * Method 'getUserId'
	 * 
	 * @return int
	 */
	public int getUserId()
	{
		return userId;
	}

	/**
	 * Method 'setUserId'
	 * 
	 * @param userId
	 */
	public void setUserId(int userId)
	{
		this.userId = userId;
	}

	/**
	 * Method 'getWebResourceId'
	 * 
	 * @return int
	 */
	public int getWebResourceId()
	{
		return webResourceId;
	}

	/**
	 * Method 'setWebResourceId'
	 * 
	 * @param webResourceId
	 */
	public void setWebResourceId(int webResourceId)
	{
		this.webResourceId = webResourceId;
	}

	/**
	 * Method 'getTime'
	 * 
	 * @return Date
	 */
	public Date getTime()
	{
		return time;
	}

	/**
	 * Method 'setTime'
	 * 
	 * @param time
	 */
	public void setTime(Date time)
	{
		this.time = time;
	}

	/**
	 * Method 'equals'
	 * 
	 * @param _other
	 * @return boolean
	 */
	public boolean equals(Object _other)
	{
		if (_other == null) {
			return false;
		}
		
		if (_other == this) {
			return true;
		}
		
		if (!(_other instanceof Comment)) {
			return false;
		}
		
		final Comment _cast = (Comment) _other;
		if (id != _cast.id) {
			return false;
		}
		
		if (text == null ? _cast.text != text : !text.equals( _cast.text )) {
			return false;
		}
		
		if (userId != _cast.userId) {
			return false;
		}
		
		if (webResourceId != _cast.webResourceId) {
			return false;
		}
		
		if (time == null ? _cast.time != time : !time.equals( _cast.time )) {
			return false;
		}
		
		return true;
	}

	/**
	 * Method 'hashCode'
	 * 
	 * @return int
	 */
	public int hashCode()
	{
		int _hashCode = 0;
		_hashCode = 29 * _hashCode + id;
		if (text != null) {
			_hashCode = 29 * _hashCode + text.hashCode();
		}
		
		_hashCode = 29 * _hashCode + userId;
		_hashCode = 29 * _hashCode + webResourceId;
		if (time != null) {
			_hashCode = 29 * _hashCode + time.hashCode();
		}
		
		return _hashCode;
	}

	/**
	 * Method 'createPk'
	 * 
	 * @return CommentPk
	 */
	public CommentPk createPk()
	{
		return new CommentPk(id);
	}

	/**
	 * Method 'toString'
	 * 
	 * @return String
	 */
	public String toString()
	{
		StringBuffer ret = new StringBuffer();
		ret.append( "com.netas.kekmanager.dao.dto.Comment: " );
		ret.append( "id=" + id );
		ret.append( ", text=" + text );
		ret.append( ", userId=" + userId );
		ret.append( ", webResourceId=" + webResourceId );
		ret.append( ", time=" + time );
		return ret.toString();
	}

}
